Skip to content

docs: document the opt-in response cache (stage 1/5)#405

Draft
zhongxuanwang-nv wants to merge 2 commits into
NVIDIA:mainfrom
zhongxuanwang-nv:docs/response-cache-stage1
Draft

docs: document the opt-in response cache (stage 1/5)#405
zhongxuanwang-nv wants to merge 2 commits into
NVIDIA:mainfrom
zhongxuanwang-nv:docs/response-cache-stage1

Conversation

@zhongxuanwang-nv

@zhongxuanwang-nv zhongxuanwang-nv commented Jul 10, 2026

Copy link
Copy Markdown
Member

PLEASE IGNORE THIS PR FOR NOW

Overview

Depends on #404 — this branch stacks on the stage-1 code branch, so the diff shows both commits until #404 merges; only the last commit (docs:) is new here. Kept in draft until #404 lands.

Documents the opt-in response cache on the documentation site: a new Response Cache page in the Adaptive plugin section, written in plain language with runnable examples — when to use it, a plugins.toml quickstart, per-language plugin configuration (Python/Node.js/Rust), what gets cached (complete answers only, streaming aggregation and native replay), how cache keys are built, observability (nemo-relay doctor, response_cache marks), a full field reference, and the unredacted-at-rest caveat for shared Redis deployments. Docs PR 1/5 of the response-cache series.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Adds docs/adaptive-plugin/response-cache.mdx (position 5 in the Adaptive plugin section), following the ACG page skeleton: intro → When To Use It → plugins.toml example → Plugin Configuration tabs → Manual API tabs → What Gets Cached → Cache Keys → Observability → Fields → Common Validation Failures.
  • Cross-links the new page from docs/adaptive-plugin/about.mdx (coordination list and Pages list) and docs/adaptive-plugin/configuration.mdx (Component Shape table and area-pages paragraph).
  • No README changes: feature documentation lives on the docs site alongside the other adaptive plugin feature pages.
  • Validated with fern check and fern docs broken-links --strict (the only reported broken links are the pre-existing generated API-reference pages, regenerated by just docs).

Where should the reviewer start?

docs/adaptive-plugin/response-cache.mdx — the page is the whole change (one commit on top of #404).

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: e65fbbe7-42c7-4cab-933b-275eb872ffd9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:XXL PR is very large Documentation documentation-related lang:go PR changes/introduces Go code lang:js PR changes/introduces Javascript/Typescript code lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code labels Jul 10, 2026
@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

License Diff

Compared against origin/main.

Lockfile license changes

Lockfile License Changes

Rust

Added

  • None

Removed

  • None

Updated/Changed

  • None

Node

Added

  • None

Removed

  • None

Updated/Changed

  • None

Python

Added

  • None

Removed

  • None

Updated/Changed

  • None
Status output
[license-diff] selected languages: rust, node, python
[license-diff] generating current inventory
[license-diff] current: generating Rust inventory
[license-diff] current: Rust inventory complete (378 packages)
[license-diff] current: generating Node inventory
[license-diff] current: Node inventory complete (363 packages)
[license-diff] current: generating Python inventory
[license-diff] current: Python inventory complete (105 packages)
[license-diff] current inventory complete
[license-diff] checking out base ref origin/main into a temporary worktree
[license-diff] base: generating Rust inventory
[license-diff] base: Rust inventory complete (378 packages)
[license-diff] base: generating Node inventory
[license-diff] base: Node inventory complete (363 packages)
[license-diff] base: generating Python inventory
[license-diff] base: Python inventory complete (105 packages)
[license-diff] base inventory complete
[license-diff] removing temporary base worktree
[license-diff] comparing inventories
[license-diff] rendering Markdown output
[license-diff] done

An opt-in feature of the adaptive plugin (a response_cache config
section, not a new plugin kind): managed LLM calls are keyed by a
SHA-256 fingerprint of the normalized request and repeats are served
from the store — instant, free, reproducible. Buffered and streaming
calls share one keyspace; a streamed miss is teed and stored as its
aggregated response, a hit replays provider-native chunks.

Keying auto-detects the provider surface from the request shape and
trusts the decode only where it is faithful: known-lossy shapes and
decodes that fail to round-trip fall back to raw-body fingerprinting,
which can only cost a miss. Stateful calls (Responses persistence,
conversations, containers) and nondeterministic calls under the safety
toggle bypass entirely. Stored answers must be complete: non-null
errors, non-final statuses, truncated or lossily-collected streams, and
upstream failures are never cached — the CLI gateway relays failed
upstream replies to the client verbatim while keeping them invisible to
the execution chain.

The in-memory store is bounded by an honest resident-size budget with
oldest-first eviction; the Redis backend runs under hard deadlines and
re-checks entry expiry. Everything fails open: any cache error falls
through to a live call. Same config surface in Rust, Python, Node, and
Go; doctor reports configuration and backend reachability; hit/miss/
bypass marks carry fingerprints and savings, never bodies.

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Adds a Response Cache page to the adaptive plugin docs: when to use it,
a plugins.toml quickstart, per-language plugin configuration, the
complete-answers-only storage rules with streaming aggregation and
native replay, exact-request key normalization, the response_cache mark
and doctor surfaces, a field reference, and the unredacted-at-rest
caveat for shared Redis deployments. Links the page from the adaptive
About and Configuration pages.

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation documentation-related lang:go PR changes/introduces Go code lang:js PR changes/introduces Javascript/Typescript code lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code size:XXL PR is very large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant